package com.glsc.ngateway.common.base.repo.mysql.gateway.other;

import com.glsc.ngateway.common.base.domain.mysql.gateway.other.TradeSeatFileUploadLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface TradeSeatFileUploadLogRepository extends JpaRepository<TradeSeatFileUploadLog, Integer>, JpaSpecificationExecutor<TradeSeatFileUploadLog> {

    /**
     * 根据文件名称和市场信息查询文件是否上传过
     *
     * @param fileNames
     * @param tradeSeatMarket
     * @return
     */
    @Query(value = "select t.* from t_am_trade_seat_file_upload_log t where t.file_name in :fileNames and t.trade_seat_market = :tradeSeatMarket", nativeQuery = true)
    List<TradeSeatFileUploadLog> listTradeSeatFeesDto(List<String> fileNames, String tradeSeatMarket);


}
